<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>作业日志设置</title>
<link rel="stylesheet" type="text/css" href="../../css/reset.css" />
<link rel="stylesheet" type="text/css" href="../../css/css.css" />
<link rel="stylesheet" type="text/css"
	href="../../js/jquery-easyui-1.4.3/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css"
	href="../../js/jquery-easyui-1.4.3/themes/icon.css" />
<link rel="stylesheet" type="text/css"
	href="../../js/SimpleTree1.3/js/tree_themes/SimpleTree.css" />
<link rel="stylesheet" type="text/css" href="../../css/colorReset.css" />
<style>
html, body {
	width: 100%;
	height: 100%;
	font-size: 16px;
}

.textbox {
	-webkit-border-radius: 0;
	border-radius: 0;
}

.combo {
	border-color: #d3d7da;
}

.title {
	width: 80%;
	margin: 0 auto;
	padding: 10px 0 10px 0;
	font-size: 25px;
	text-align: center;
}

.title h2 img {
	width: 176px;
}

.main {
	position: relative;
	width: 410px;
	height: 150px;
	margin: 20px auto 0;
	border: none;
	padding: 0;
	border-radius: 4px;
	background: #fff;
}

.regist_con_tit {
	width: 100%;
	height: 40px;
	line-height: 40px;
	text-align: center;
	vertical-align: middle;
	/*background: #30badf;*/
	background: url(../../images/tree_header.png) left top repeat-x;
	color: #fff;
	border-radius: 5px 5px 0 0;
}

.regist_con {
	width: 410px;
	margin: 0 auto;
}

.regist_con h3 {
	text-align: center;
	font-size: 14px;
	font-weight: bold;
	background: rgb(210, 224, 242);
	padding: 5px;
}

.regist_con ul {
	margin: 10px auto;
	width: 100%;
	overflow: hidden;
}

.regist_con ul li {
	display: block;
	float: left;
	height: 25px;
	overflow: hidden;
	padding: 5px 0;
}

.regist_con ul li.li_col {
	width: 100%;
	height: auto;
}

.regist_con .text {
	width: 270px;
	border: 1px solid #d3d7da;
	padding: 2px 3px;
	border-radius: 0;
	height: 20px;
	line-height: 20px;
	vertical-align: middle;
}

.regist_con .label {
	width: 100%;
	text-align: center;
	display: block;
	float: left;
	line-height: 25px;
}

.regist_con .input_con {
	float: left;
	margin-left: 10px;
}

.regist_con .input_con .input_con_li {
	padding: 5px 0;
}

.btn-con {
	margin-top: 20px;
	text-align: center;
}

.btn-con>button {
	margin: 0 auto;
}
</style>
</head>

<body>
	<div class="title">
		<h2>
			<img src="../../images/logo.png" alt="" />
		</h2>
	</div>
	<div class="main">
		<div class="border_con top-border">
			<div class="corner_con left-top-corner"></div>
			<div class="corner_con right-top-corner"></div>
		</div>
		<div class="border_con left-border"></div>
		<div class="main-con">
			<div class="regist_con_tit">作业日志设置</div>
			<div class="regist_con">
				<form id="SaveOrUpdateForm">
					<ul>
						<li class="li_col">
							<div style="text-align: center">
								<input id="ifChange" type="checkbox" /> <label>是否保存输入输出量为0并且执行成功的日志</label>
							</div>
						</li>
						<li class="li_col"><label class="label" id="ifChange"></label>
						</li>
						<li class="li_col btn-con" style="text-align: center"><input
							style="margin: 0 auto;" type="button" class="default_btn"
							onclick="changeResult()" value="保存" /></li>
					</ul>
				</form>
			</div>
		</div>
		<div class="border_con right-border"></div>
		<div class="border_con bottom-border">
			<div class="corner_con left-bottom-corner"></div>
			<div class="corner_con right-bottom-corner"></div>
		</div>
	</div>

	<script type="text/javascript" src="/webjars/json3/3.3.2/json3.min.js"></script>
	<script type="text/javascript"
		src="../../js/jquery-easyui-1.4.3/jquery.min.js"></script>
	<script type="text/javascript"
		src="../../js/jquery-easyui-1.4.3/jquery.easyui.min.js"></script>
	<script type="text/javascript"
		src="../../js/jquery-easyui-1.4.3/locale/easyui-lang-zh_CN.js"></script>

	<script type="text/javascript" src="../../js/cook/constants.js"></script>
	<script type="text/javascript" src="../../js/cook/FormValidate.js"></script>
	<script>
 $(document).ready(function(){
	$.ajax({
		url:BASE_URL_HISTORY_INTERFACE+ '/getchange/forLog' +'?v=' + Math.random(),
		dataType:'json',
		type:'get',
		contentType:"application/json",
		success:function(data){
			if(data.logField == false){
				$("#ifChange")[0].checked=true;
			}else{
				$("#ifChange")[0].checked=false;
			}
		}
	});
	
});


function changeResult(){
	var check = $("#ifChange")[0].checked;
	var changeInfo;
	if(check==true){
		changeInfo = "保存";
	}else{
		changeInfo = "不保存";
	}
	var param={changeInfo:changeInfo};
	$.ajax({
		url:BASE_URL_HISTORY_INTERFACE+ '/change/forLog' +'?v=' + Math.random(),
		dataType:'json',
		type:'get',
		data:param,
		contentType:"application/json",
		success:function(data){
			if(data.logField==false){
				$("#ifChange")[0].checked=true;
			}else{
				$("#ifChange")[0].checked=false;
			}
			$.messager.alert("提示","<p>设置成功！</p>","info");	
		},
		error:function(xhr,s,err){
			$.messager.alert("错误","<p>服务异常</p>","error");	
		}
	});
} 
</script>
</body>
</html>
